<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>default_policy&lt;T, EC, EP&gt; - Boost.Outcome documentation</title>
<link rel="stylesheet" href="../../css/boost.css" type="text/css">
<meta name="generator" content="Hugo 0.52 with Boostdoc theme">
<meta name="viewport" content="width=device-width,initial-scale=1.0"/>

<link rel="icon" href="../../images/favicon.ico" type="image/ico"/>
<body><div class="spirit-nav">
<a accesskey="p" href="../../reference/aliases/checked.html"><img src="../../images/prev.png" alt="Prev"></a>
    <a accesskey="u" href="../../reference/aliases.html"><img src="../../images/up.png" alt="Up"></a>
    <a accesskey="h" href="../../index.html"><img src="../../images/home.png" alt="Home"></a><a accesskey="n" href="../../reference/aliases/outcome.html"><img src="../../images/next.png" alt="Next"></a></div><div id="content">
  <div class="titlepage"><div><div><h1 style="clear: both"><code>default_policy&lt;T, EC, EP&gt;</code></h1></div></div></div>
  <p>A type alias to a no-value policy selected based on traits matching of <code>T</code>, <code>EC</code> and <code>EP</code>. It is defined as follows:</p>

<ol>
<li><p>If <code>EC</code> and <code>EP</code> is <code>void</code>, choose <a href="../../reference/policies/terminate.html" class="api-reference"><code>terminate</code></a>
.</p></li>

<li><p>If <a href="../../reference/traits/is_error_code_available.html" class="api-reference"><code>is_error_code_available&lt;T&gt;</code></a>
 true for <code>EC</code>, choose <a href="../../reference/policies/error_code_throw_as_system_error_outcome.html" class="api-reference"><code>error_code_throw_as_system_error&lt;T, EC, EP&gt;</code></a>
 for <code>basic_outcome</code> or <a href="../../reference/policies/error_code_throw_as_system_error_result.html" class="api-reference"><code>error_code_throw_as_system_error&lt;T, EC, void&gt;</code></a>
 for <code>basic_result</code>.</p></li>

<li><p>If <a href="../../reference/traits/is_exception_ptr_available.html" class="api-reference"><code>is_exception_ptr_available&lt;T&gt;</code></a>
 true for <code>EC</code> or <code>EP</code>, choose <a href="../../reference/policies/exception_ptr_rethrow_outcome.html" class="api-reference"><code>exception_ptr_rethrow&lt;T, EC, EP&gt;</code></a>
 for <code>basic_outcome</code> or <a href="../../reference/policies/exception_ptr_rethrow_result.html" class="api-reference"><code>exception_ptr_rethrow&lt;T, EC, void&gt;</code></a>
 for <code>basic_result</code>.</p></li>

<li><p>Else choose <a href="../../reference/policies/fail_to_compile_observers.html" class="api-reference"><code>fail_to_compile_observers</code></a>
, which fails the build with a useful message.</p></li>
</ol>

<p><em>Namespace</em>: <code>BOOST_OUTCOME_V2_NAMESPACE::policy</code></p>

<p><em>Header</em>: <code>&lt;boost/outcome/std_result.hpp&gt;</code></p>


        </div><p><small>Last revised: February 05, 2019 at 21:41:47 UTC</small></p>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../../reference/aliases/checked.html"><img src="../../images/prev.png" alt="Prev"></a>
    <a accesskey="u" href="../../reference/aliases.html"><img src="../../images/up.png" alt="Up"></a>
    <a accesskey="h" href="../../index.html"><img src="../../images/home.png" alt="Home"></a><a accesskey="n" href="../../reference/aliases/outcome.html"><img src="../../images/next.png" alt="Next"></a></div></body>
</html>
